package zero.tech.games.gate.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import zero.tech.games.entity.games.ClubMemberRole;

public interface ClubMemberRoleMapper {

	@Insert("insert into club_member_role(club_id,uid,role,permission_id) "
			+ "values(#{club_id},#{uid},#{role},#{permission_id})")
	void insert(ClubMemberRole clubMemberRole);

	@Select("select * from club_member_role where club_id=#{club_id} and uid=#{uid}")
	ClubMemberRole getClubMemberRole(@Param("club_id")int club_id, @Param("uid")int uid);

	@Update("update club_member_role set role=#{role},permission_id=#{permission_id} where club_id=#{club_id} and uid=#{uid}")
	void updateRoleAndPermission(@Param("club_id")int club_id, @Param("uid")int uid,@Param("role") int role, @Param("permission_id") Integer permission_id);

	@Delete("delete from club_member_role where club_id=#{club_id} and uid=#{uid}")
	void delete(@Param("club_id")int club_id, @Param("uid")int uid);

}
